﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _92检查数组中是否有重复元素
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            int[] arr1 = { 6, 1, 9, 11, 3, 0 };

            bool b = RepeatElement(arr1);
            Console.WriteLine(b);
        }

        private static bool RepeatElement(int[] arr)
        {
            for (int i = 0; i < arr.Length - 1; i++)//取比较数
            {
                for (int j = i + 1; j < arr.Length; j++)
                {
                    if (arr[i] == arr[j])
                    {
                        return true;
                    }
                }
            }
            return false;
        }
    }
}